﻿<Configuration:SynchronizationConfigurationDictionary x:Class="DragonSpark.Testing.Resources.CollectionMappings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Configuration="clr-namespace:DragonSpark.Objects.Synchronization.Configuration;assembly=DragonSpark" xmlns:CoreConfiguration="clr-namespace:DragonSpark.Objects.Configuration;assembly=DragonSpark" xmlns:Synchronization="clr-namespace:DragonSpark.Testing.TestObjects.Synchronization">
	<CoreConfiguration:ObjectResolver x:Key="Resolver" ItemType="{x:Type Synchronization:EntityChild}">
		<CoreConfiguration:ObjectResolver.ObjectFinder>
			<CoreConfiguration:ObjectFinder ObjectFinderType="{x:Type Synchronization:EntityChildFinder}" />
		</CoreConfiguration:ObjectResolver.ObjectFinder>
		<CoreConfiguration:ObjectResolver.InstanceSource>
			<CoreConfiguration:InstanceSource SourceType="{x:Type Synchronization:EntityViewChild}" ResultType="{x:Type Synchronization:EntityChild}" />
		</CoreConfiguration:ObjectResolver.InstanceSource>
	</CoreConfiguration:ObjectResolver>

	<Configuration:SynchronizationKey x:Key="KeyEntityViewEntity" First="{x:Type Synchronization:EntityViewWithCollectionProperty}" Second="{x:Type Synchronization:EntityWithCollectionProperty}" />
	<Configuration:SynchronizationKey x:Key="KeyEntityViewChildEntityChild" First="{x:Type Synchronization:EntityViewChild}" Second="{x:Type Synchronization:EntityChild}" Configuration:SynchronizationKey.KeyName="ChildNamingKey" />

	<Configuration:SynchronizationContainer x:Key="DefaultContainer">
		<Configuration:SynchronizationContainer.Policies>

			<Configuration:SynchronizationPolicy Key="{StaticResource KeyEntityViewEntity}">
				<Configuration:SynchronizationContexts>
					<Configuration:ListSynchronizationContext ObjectResolver="{StaticResource Resolver}" MappingName="ChildNamingKey" FirstExpression="ChildViews" SecondExpression="Children" />
				</Configuration:SynchronizationContexts>
			</Configuration:SynchronizationPolicy>

			<Configuration:SynchronizationPolicy Key="{StaticResource KeyEntityViewChildEntityChild}">
				<Configuration:SimilarProperties />
			</Configuration:SynchronizationPolicy>

		</Configuration:SynchronizationContainer.Policies>
	</Configuration:SynchronizationContainer>
</Configuration:SynchronizationConfigurationDictionary>
